package org.speed.jdk.rmi;

import java.rmi.Naming;
import java.rmi.Remote;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;


public class ExportServer {

	public static void main(String[] args) throws Exception {
		Registry registry = LocateRegistry.createRegistry(8088);
		registry.bind("userService", new UserServiceImpl());
	
		
		String[] list = registry.list();
		for (String string : list) {
			System.out.println(string);
		}
		
		Remote remote = Naming.lookup("rmi://127.0.0.1:8088/userService");
		IUserService userService = (IUserService) remote;
		userService.exec();
		
	}

}
